<?php

function tbnd_save_user( $data ){
   return db_insert('tbnd_info_user')
        ->fields(array(
            'uid'       =>  $data['uid'],               
            'name' 		=> $data['txt_signup_fullname'] ,
            'address' 	=> $data['txt_signup_address'] ?  $data['txt_signup_address'] : '',
            'phone' 	=> $data['txt_signup_phone'] ?  $data['txt_signup_phone'] : '',     
            ))
        ->execute();
}

function tbnd_save_oauth_user($email , $uid , $oauth , $type , $status , $time){
     return db_insert('tbnd_user_oauth')
        ->fields(array(
			'email' 		=> $email , 
            'uid'       	=> $uid ,               
            'oauth_id' 		=> $oauth ,
            'type_oauth' 	=>  $type , 
            'status' => $status ? $status : NOT_ACTIVED , 
            'time_oauth' 	=> $time ? $time :0,    
            ))
        ->execute();
}
